﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MefTZAddin
{
    public static class OperatingSystemUtil
    {
        // Windows 7 RTM is 6.1.7100
        private static OperatingSystem WINDOWS_7_VERSION;
        private static OperatingSystem os = null;

        static OperatingSystemUtil()
        {
            WINDOWS_7_VERSION = new OperatingSystem(PlatformID.Win32NT, new Version(6, 1));
            os = Environment.OSVersion;
        }

        public static bool MeetsOrExceedsWin7()
        {
            return MeetsOrExceedsWin7(WINDOWS_7_VERSION);
        }

        public static bool MeetsOrExceedsWin7(OperatingSystem platformVersion)
        {
            if (os.Platform != platformVersion.Platform || os.Version < platformVersion.Version)
                return false;
            else
                return true;
        }
    }
}
